
// 并发请求（存在问题需要改进）
async function requestUtil(requestList,limit){
    let count=0
    let executeResultList=[]

    return new Promise((resolve)=>{
        function run(){

            if (count>limit){
                return
            }

            if (requestList.length===0){
                resolve(executeResultList)
            }

            const request= requestList.shift()
            count++

            request.then(res=>{
                executeResultList.push({status:'fulfilled',value:res})

            }).catch(err=>{
                executeResultList.push({status:'rejected',value:err.message})

            }).finally(()=>{
                count--
                run()
            })
        }
    })
}
